<template>
  <div>
        <el-table :data="infoList" border>
          <el-table-column label="用工单位名称" align="center" prop="enterpriseName" />
          <el-table-column label="培训类型" align="center" prop="trainingType" />   
          <el-table-column label="培训日期" align="center" prop="trainingTime" /> 
              <el-table-column label="操作" align="center" prop="case" >
                <template slot-scope="scope">
                        <el-button
                        size="mini"
                        type="text"
                        @click="handleDetail(scope.row)"
                        >查看详情</el-button>
                </template>
            </el-table-column > 
        </el-table>
        <pagination
            v-show="total>0"
            :total="total"
            :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize"
            @pagination="getEducationTouchFn"
          />
  </div>
</template>

<script>
import { getEducationTouch} from "@/api/zhangping/occupational";
export default {
    data() {
      return {
         infoList:[],
         queryParams:{
              creditCode:'', 
              pageNum: 1,
              pageSize: 10,
         },
         total:0
      };
    },
    created() {
        this.queryParams.creditCode = this.$route.query.creditCode
       
    },
    mounted(){
        this.getEducationTouchFn()  
    },
    methods: {
      getEducationTouchFn(){
            getEducationTouch(this.queryParams).then(res=>{
                  if(res.code == 200){
                        this.infoList = res.rows
                        this.total = res.total
                  }else{
                        this.$message.error(res.msg);  
                  }    
            })
        },
        handleDetail(item){
               this.$router.push(`/careerHygiene/test2/educationDetail?id=${item.id}`)
        },
        goBackBtn(){
          this.$router.back()
        },
    }
  };
</script>
<style lang="scss" scoped>
       ::v-deep{  
           .el-table__header-wrapper th{
                 background: #F4F8FF!important;       
           }
        }  
</style>
